package com.test.user;

import java.util.HashMap;
import java.util.Map;

import com.google.android.gms.maps.model.LatLng;

class UserFactory
{
	UserFactory()
	{
		hashUser = new HashMap<String, OtherUser>();
	}
	
	public void addUser(OtherUser userData)
	{
		hashUser.put(userData.getId(), userData);
	}
	
	public OtherUser getUser(String userId)
	{
		return hashUser.get(userId);
	}
	
	public void clear()
	{
		hashUser.clear();
	}
	
	public Map<String, OtherUser> getHashUser()
	{
		return hashUser;
	}

	public void setHashUser(Map<String, OtherUser> hashUser)
	{
		this.hashUser = hashUser;
	}

	private Map<String, OtherUser> hashUser;
	
}

public class OtherUser
{
	public OtherUser()
	{
		id = "";
		name = "";
		location = new LatLng(0., 0.);
		onlStat = 0;
	}
	
	public OtherUser(String id, String name, LatLng location, int onlStat)
	{
		this.id = id;
		this.name = name;
		this.location = location;
		this.onlStat = onlStat;
	}

	public String getId()
	{
		return id;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public LatLng getLocation()
	{
		return location;
	}

	public void setLocation(LatLng location)
	{
		this.location = location;
	}

	public String getMail()
	{
		return mail;
	}

	public void setMail(String mail)
	{
		this.mail = mail;
	}
	
	public int getOnlStat()
	{
		return onlStat;
	}

	public void setOnline(int onlStat)
	{
		this.onlStat = onlStat;
	}
	
	@Override
	public String toString()
	{
		return "User [name : " + name + ", id : " + id + ", location : (" + location.latitude + "," + location.longitude + "), " + "onlStat : " + onlStat;
	}

	private String id;
	private String name;
	private LatLng location;
	private String mail;
	private int onlStat;	
}
